package com.example.student;

import java.util.ArrayList;
import java.util.List;

public class SchoolClass {
    /**
     * 班级名称
     */
    private String classname;
    /**
     * 班级ID
     */
    private String classId;
    /**
     * 班级学生
     */
    private List<Student> students = new ArrayList<>();

    /**
     * 增加学生
     * 
     * @param student
     */

    public boolean addStudent(Student student) {
        if(student==null){
            System.out.println("学生信息为空，请重新输入");
            return false;
        }
        students.add(student);
        System.out.println("学生"+student.getNeme()+"新增学生成功");
        return true;
    }

    public String getClassname() {
        return classname;
    }

    public void setClassname(String classname) {
        this.classname = classname;
    }

    public String getClassId() {
        return classId;
    }

    public void setClassId(String classId) {
        this.classId = classId;
    }

    public List<Student> getStudents() {
        return students;
    }

    public void setStudents(List<Student> students) {
        this.students = students;
    }

    @Override
    public String toString() {
        return "SchoolClass [classname=" + classname + ", classId=" + classId + ", students=" + students + "]";
    }

}
